var QcloudSms = require("qcloudsms_js");
var appid = '1400287655'
var appkey = '5d1bfb827ea8ad74278ec617222da518'
var qcloudsmscase = QcloudSms(appid, appkey);
var templateID = '474852'
let sign = '弈飞围棋'

module.exports.sendVerification =  function sendVerification(code,phone,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		var params = [code]
		ssender.sendWithParam( 86, phone, templateID,
			  [String(code),30],sign,"", "", function(err,res,resData){
			  	callback(err,res,resData)

			})
	}


module.exports.sendLeaveNotification =  function sendLeaveNotification(name,phone,thisClass,time,callback){
		var ssender = qcloudsmscase.SmsSingleSender();
		var bbb = qcloudsmscase.SmsMumtiSender();
		ssender.sendWithParam( 86, phone, 527544,
			  [name,thisClass,time],sign,"", "", function(err,res,resData){
			  	callback(err,res,resData)
			})
	}

module.exports.sendApproveNotification =  function sendApproveNotification(school,name,type,phone,callback){
		// phone = ['15021144140']
		var ssender = qcloudsmscase.SmsSingleSender();
		var bbb = qcloudsmscase.SmsMultiSender();
		bbb.sendWithParam( 86, phone, 527548,
			  [school,name,type],sign,"", "", function(err,res,resData){
			  	callback(err,res,resData)
			})
	}

module.exports.sendInOutNotification =  function sendInOutNotification(school,phone,callback){
		// phone = ['15021144140']
		var ssender = qcloudsmscase.SmsSingleSender();
		var bbb = qcloudsmscase.SmsMultiSender();
		bbb.sendWithParam( 86, phone, 529412,
			  [school],sign,"", "", function(err,res,resData){
			  	callback(err,res,resData)
			})
	}


module.exports.sendResultNotification =  function sendResultNotification(notifType,result,phone,callback){
		// phone = ['15021144140']
		var ssender = qcloudsmscase.SmsSingleSender();
		var bbb = qcloudsmscase.SmsMultiSender();
		bbb.sendWithParam( 86, phone, 552222,
			  [notifType,result],sign,"", "", function(err,res,resData){
			  	callback(err,res,resData)
			})
	}

	
	